package com.visikard.response;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import com.visikard.item.ItemCouponsBuilderCreate;

public class GetCouponDetailResponse extends BaseResponse {
	private ItemCouponsBuilderCreate itemCouponBuilderCreate;

	public ItemCouponsBuilderCreate getItemCouponBuilderCreate() {
		return itemCouponBuilderCreate;
	}

	public void setItemCouponBuilderCreate(ItemCouponsBuilderCreate itemCouponBuilderCreate) {
		this.itemCouponBuilderCreate = itemCouponBuilderCreate;
	}

	@Override
	public void extractDataFromServer(String response) throws JSONException {
		super.extractDataFromServer(response);
		// response OK
		if (errorCode == SUCCESS) {
			JSONArray jsArr = getDataJArray(response);
			itemCouponBuilderCreate = new ItemCouponsBuilderCreate((JSONObject) jsArr.get(0));
		}
	}
}
